If you want to execute some code if a condition is true and another code if a condition is false, use the if....else statement.

Syntax

if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is false
}

#Title: If and If...else Statement
#Element: 238: If and If...else Statement
#Article: 171: Conditional Statements